package com.bootdo.wechat.config;

import com.bootdo.common.redis.shiro.RedisManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.autoconfigure.session.SessionProperties;
import org.springframework.data.redis.cache.RedisCache;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;

@Component
public class InitWxHandler implements ApplicationRunner {
    @Value("${wechat.url}")
    private String url;

    @Override
    public void run(ApplicationArguments applicationArguments) throws Exception {
        WxHandlerInitialize wxHandlerInitialize = new WxHandlerInitialize();
        RedisManager redisManager= new RedisManager();
        Jedis jedis = redisManager.getJedis();
        jedis.set("HostUrl",url);
        System.out.println("初始化啦~~~~~");
        wxHandlerInitialize.init();
    }
}
